package com.millstein.tsinglog.commons.constant;

public class SystemConstant {

	// 实体类的状态
	public static final Short STATUS_ENTITY_NORMAL = 1; // 正常
	public static final Short STATUS_ENTITY_DELETE = 0; // 删除
	public static final Short USABLE_ENTITY_ON = 1; // 启用
	public static final Short USABLE_ENTITY_OFF = 0; // 禁用

	// 分页相关
	public static final Integer DEFAULT_CURRENT_PAGE = 1; // 默认当前页为第一页
	public static final Integer DEFAULT_PAGE_SIZE = 10; // 默认每页显示10条数据
	public static final Integer PAGE_SIZE_FOR_UNCHECKED_COMMENT = 5; // 针对于header中查找未审核评论时使用的pageSize，固定只查前5条数据
	public static final Integer PAGE_SIZE_FOR_NOTICE_OF_USABLE = 5; // 查询可用公告时，只需查5条数据
	public static final Integer PAGE_SIZE_FOR_CAROUSEL_IMAGE_SAVE_MODAL = 3; // 针对新增轮播图图片模态框中的数据，固定每页显示3条数据

	// 文章对象相关的状态
	public static final Short ARTICLE_IS_RELEASED = 1; // 发布
	public static final Short ARTICLE_IS_NOT_RELEASED = 0; // 不发布
	public static final Short ARTICLE_CAN_COMMENT = 1; // 允许评论
	public static final Short ARTICLE_CANNOT_COMMENT = 0; // 不允许评论
	public static final Short ARTICLE_IS_UP_TO_TOP = 1; // 置顶
	public static final Short ARTICLE_IS_NOT_UP_TO_TOP = 0; // 不置顶
	public static final String ARTICLE_IS_NOT_RELEASED_MESSAGE = "该文章尚未发布"; // 文章没有发布时的信息

	// 上传
//	public static final String UPLOAD_URL = "E:/var/uploadImages"; // 上传图片的路径
//	public static final String UPLOAD_URL = "/var/uploadImages"; // 上传图片的路径
//	public static final String ALLOWED_PIC_TYPES = "jpg,jpeg,bmp,png,gif"; // 允许上传的图片类型
	public static final Integer MAX_SIZE_OF_UPLOAD = 10; // 最大文件上传大小，单位为MB

	// 优先级
	public static final Integer FIRST_PRIORITY = 1; // 最高优先级

	// 分类

	// 标签

	// 评论
	public static final String DEFAULT_IP_ADDRESS = "未知"; // 默认的ip地址
	public static final Short COMMENT_HAS_NOT_BEEN_AUDITED = 1; // 尚未审核
	public static final Short COMMENT_HAS_BEEN_AUDITED_PASS = 2; // 审核通过
	public static final Short COMMENT_HAS_BEEN_AUDITED_FAILURE = 3; // 审核失败
	public static final Integer DEFAULT_SUPPORT_COUNT = 0; // 默认的赞的数量
	public static final Integer DEFAULT_OPPOSE_COUNT = 0; // 默认的踩的数量
	public static final String DEFAULT_COMMENT_TIME = "尚未审核"; // 默认的审核时间

	// 公告
	public static final Short FRONT_END = 1; // 类型为前端页面公告
	public static final Short BACK_END = 2; // 类型为管理后台公告
	public static final Integer MAX_COUNT_OF_USABLE_NOTICE_FOR_EACH_TYPE = 5; // 每个类型的公告的最大启用数量

	// 轮播图
	public static final Short LOCAL_ARTICLE = 1; // 本站内文章
	public static final Short OUTER_ARTICLE = 2; // 外链文章
	public static final String INTERVAL_KEY = "interval"; // 间隙对应的数据库中的配置项名称
	public static final String MAX_NUM_KEY = "showNum"; // 最大播放图片数对应的数据库中的配置项名称
	public static final String ALLOWED_SHOW_IMAGE_NUM_FOR_PORTAL = "3,5,7,9"; // 前台允许设置的轮播图数量

	// 首页
	public static final Integer STATISTICS_TODAY = 1;
	public static final Integer STATISTICS_THIS_MONTH = 2;
	public static final Integer STATISTICS_ALL = 3;
	public static final String THE_TIME_ERA = "1970-01-01 00:00:00"; // 时间元年

	// 占位符相关
	public static final String PATH_PORTAL_PLACEHOLDER = "__%PATH_PORTAL_PLACEHOLDER%__"; // 前台链接的占位符
	public static final String PATH_SERVER_PLACEHOLDER = "__%PATH_SERVER_PLACEHOLDER%__"; // 后台链接的占位符
	public static final String PATH_MANAGER = "http://manager.tsinglog.online"; // 后台管理端的地址

	// 用户和角色
	public static final String ROOT_NAME = "超级管理员"; // 管理员的用户名
	public static final String DEFAULT_USER_AVATAR = "default.jpg"; // 管理员的头像
	public static final String ADMIN_EMAIL = ""; // 管理员邮箱的占位
	public static final String DEFAULT_PASSWORD = "111111"; // 用户创建时的初始密码
	public static final Integer DEFAULT_LOGIN_COUNT = 0; // 用户的初始登录次数
	public static final Integer ENCRYPT_TIMES = 5; // 加密次数。没有特殊情况不能更改，更改后以前的用户都会登录不了
	public static final String ENCRYPT_ARITHMETIC = "MD5"; // 加密算法。没有特殊情况不能更改，更改后以前的用户都会登录不了

	// 权限
	public static final Short PERMISSION_TYPE_MENU = 1;
	public static final Short PERMISSION_TYPE_BUTTON = 2;

	// 日志
	public static final Short LEVEL_DEBUG = 1; // debug级别的日志
	public static final Short LEVEL_INFO = 2; // info级别的日志
	public static final Short LEVEL_WARNING = 3; // warning级别的日志
	public static final Short LEVEL_ERROR = 4; // error级别的日志
	public static final Short TYPE_MANAGER = 1; // 后台系统操作日志
	public static final Short TYPE_PORTAL = 2; // 前台访客日志
	public static final Short TYPE_ERROR = 3; // 异常信息日志

	// 前台相关
	public static final String IMAGE_PREFIX = "https://tsinglog.oss-cn-shanghai.aliyuncs.com/"; // 前台图片地址前缀
//	public static final String IMAGE_PREFIX = "http://image.tsinglog.online"; // 前台图片地址前缀
	public static final String PORTAL_URL = "http://www.tsinglog.online"; // 前台地址
	public static final String PORTAL_ARTICLE_URL = "http://www.tsinglog.online/article/"; // 前台文章地址
	public static final String PORTAL_SEARCH_URL = "http://www.tsinglog.online/list"; // 前台查询文章列表地址
	public static final Short INDEX_TYPE_RELEASE = 1; // 首页需要的文章类型，最近发表文章
	public static final Short INDEX_TYPE_REPLY = 2; // 首页需要的文章类型，最近回复文章
	public static final Integer DEFAULT_PAGE_SIZE_FOR_INDEX = 10; // 首页的数据量
	public static final Integer DEFAULT_PAGE_SIZE_FOR_LIST = 20; // 列表页的数据量
	public static final Integer DEFAULT_SHOW_PAGE_NUM = 5; // 前台页面上显示的分页的数量，如设置为5时显示的就是1,2,3,4,5
	public static final Short TYPE_FOR_DO_SUPPORT_FOR_COMMENT = 1; // 做支持操作
	public static final Short TYPE_FOR_DO_OPPOSE_FOR_COMMENT = 2; // 做反对操作

	// redis相关
	public static final String REDIS_PREFIX_FOR_DO_SUPPORT = "_doSupport_";
	public static final String REDIS_PREFIX_FOR_DO_OPPOSE = "_doOppose_";
	public static final String REDIS_PREFIX_FOR_DO_PREFER = "_doPrefer_";
	public static final String REDIS_PREFIX_FOR_SUBMIT_COMMENT = "_submitComment_";
	public static final String REDIS_KEY_FOR_HOT_ARTICLE = "portal:common:hotArticle";
	public static final String REDIS_KEY_FOR_TAG_INFO = "portal:common:tagInfo";
	public static final String REDIS_KEY_FOR_NOTICE_LIST = "portal:common:noticeList";
	public static final String REDIS_KEY_FOR_LATEST_RELEASE_ARTICLE = "portal:index:latestReleaseArticle";
	public static final String REDIS_KEY_FOR_LATEST_REPLY_ARTICLE = "portal:index:latestReplyArticle";
	public static final String REDIS_PREFIX_FOR_CAROUSEL = "portal:index:carousel:";
	public static final String REDIS_KEY_FOR_CAROUSEL_IMAGE_LIST = "portal:index:carouselImageList";
	public static final String REDIS_KEY_FOR_CATEGORY_LIST = "portal:list:categoryList";
}
